package com.walle.ak47.commons.utils;

import java.net.InetAddress;
import java.net.UnknownHostException;

import org.junit.Test;

public class IpUtils {

	@Test
	public void testGetIp() {
		System.err.println(IpUtils.getIp());
	}

	public static String getIp() {
		InetAddress addr = null;
		try {
			addr = InetAddress.getLocalHost();
		} catch (UnknownHostException e) {
			e.printStackTrace();
		}

		return addr.getHostAddress();
	}
}
